<template>
  <div>
    <List :nameList="nameList">
      <template #header>
        <h2>0516人员信息</h2>
      </template>

      <template v-slot:list="{ item }"> 
        <ul>
          <li>姓名：{{item.name}} --- 年龄：{{item.age}}</li>
        </ul>
      </template>
    </List>
  </div>
</template>

<script>
import List from "./components/List.vue";
export default {
  name: "App",
  data() {
    return {
      nameList: [
        { id: "001", name: "小A", age: 16 },
        { id: "001", name: "小B", age: 25 },
        { id: "001", name: "小C", age: 45 },
        { id: "001", name: "小D", age: 35 },
        { id: "001", name: "小E", age: 14 },
        { id: "001", name: "小F", age: 57 },
        { id: "001", name: "小G", age: 34 },
        { id: "001", name: "小H", age: 38 },
      ],
    };
  },
  components: { List },
};
</script>

<style>
</style>